import request from '@/utils/request'

export function list(data) {
    data.json  = true
    let url = '/live/list'
    return request.post(url,data)
}

export function all() {
    let url = '/live/all'
    return request.get(url)
}

export function down(data) {
    data.json  = true
    let config = {
        responseType: 'arraybuffer',
    }
    let url =  '/live/down'
    return request.post(url,data,config)
}

export function info(id) {
    let url = '/live/info/' + id
    return request.get(url)
}

export function save(live,goodsList) {
    let data = {live,goodsList}
    data.json = true
    return request({
        url: '/live/save',
        method: 'post',
        data
    })
}

export function update(live,goodsList) {
    let data = {live,goodsList}
    data.json = true
    return request({
        url: '/live/update',
        method: 'post',
        data
    })
}

export function remove(data) {
    let url =  '/live/delete'
    return request.post(url,data)
}

export function options() {
    let url =  '/live/dmz/options'
    return request.get(url)
}
